/**
 * @fileOverview
 * @author iNahoo
 * @since 2018/4/24.
 */
"use strict";

import React, {PureComponent, Component} from 'react';
import ReactDOM from 'react-dom';

const text = 'hello world';

class HelloWorld extends Component {
    add(key) {
        this.setState(prevState => {
            console.log(prevState);
            return {
                [key]: prevState[key] + 1,
            }
        })
    }

    render() {
        return <div>
            <h1>{text}</h1>
        </div>;
    }
}

ReactDOM.render(
    <HelloWorld></HelloWorld>,
    document.getElementById('app')
);
